using System;
using System.Collections.Generic;
using System.Text;

using ASCOM.DriverAccess;
using ASCOM.Interface;
using ASCOM.Utilities;

using TryASCOM;

namespace ConsoleTester
{
	public class Program
	{
		private void Run(string[] args)
		{
			try
			{
				string progId = Telescope.Choose("");
 
				using (TelescopeEx scope = new TelescopeEx(progId))
				{
					scope.CoordinatesChanged += new EventHandler<CoordinatesChangedEventArgs>(scope_CoordinatesChanged);

					scope.Connected = true;

					scope.SlewToCoordinatesAsync(23,75);
					
					Console.Out.WriteLine("Press [ENTER] to quit...");
					Console.In.ReadLine();
				}
				
			}
			catch (Exception err)
			{
				Console.Error.WriteLine("Exception Details:\n{0}", err.ToString());
			}
		}

		private void scope_CoordinatesChanged(object sender, CoordinatesChangedEventArgs e)
		{
			Coordinate oldC = e.OldCoordinate;
			Coordinate newC = e.NewCoordinate;

		}

		public static void Main(string[] args)
		{
			Program program = new Program();
			program.Run(args);

			Console.Out.WriteLine("Press [ENTER] to quit...");
			Console.In.ReadLine();
		}
	}
}
